import MockAdapter from "axios-mock-adapter";
import {resource} from "../config/resources";


export default {
    bindMockResponse(axios) {
        let mock = new MockAdapter(axios);
        mock.onGet(resource.index).reply(config => {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve([200, {
                        message: 'ok',
                        data: {
                            "test_key": "test_value"
                        },
                    }])
                }, 200);
            });
        });
    },
}
